import React from 'react';
import { Descriptions, Modal } from 'antd';
import { SmsTempInfo } from 'admin/schema/SmsTemplate';

interface Iprops {
  visible: boolean; // 窗口显示隐藏
  form: SmsTempInfo; // 外部数据
  onClose: () => void; // 对话框关闭时的回调
}

const SmsDetail: React.FC<Iprops> = (props: Iprops) => {
  return (
    <Modal
      width={600}
      title="模板详情"
      visible={props.visible}
      footer={null}
      destroyOnClose={true}
      onCancel={() => {
        props.onClose();
      }}
    >
      <Descriptions title={null} column={1}>
        <Descriptions.Item label="模板名称">{props.form.templateName}</Descriptions.Item>
        <Descriptions.Item label="短信内容">{props.form.content}</Descriptions.Item>
      </Descriptions>
    </Modal>
  );
};

export default SmsDetail;
